package structuralpattern.adapter.objectadapter;


public class SDAdapterTF implements SDCard {
    // 从继承SDCard改成构造函数传入TFCard
    private TFCard tfCard;

    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSD() {
        System.out.println("适配读取tf卡");
        return tfCard.readTF();
    }

    @Override
    public void writeSD(String msg) {
        System.out.println("适配写入tf卡");
        tfCard.writeTF(msg);
    }
}
